package interfaceGrafica;

import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import javax.swing.GroupLayout;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.LayoutStyle;
import logica.main.MainGrafico;
import logica.pessoa.Agencia;
import logica.pessoa.Locador;
import logica.util.Data;
import logica.util.TipoDeEntradaInvalida;
import persistencia.GeradorDeLogs;
import persistencia.MecanismoDePersistenciaSeguro;
import util.Constantes;
import util.Endereco;
import util.TipoDeLogradouro;
import util.UF;



/**
 * @author Equipe Localisa (Usa quem precisa!)
 */

@SuppressWarnings("serial")
public class InterfaceMenuGerente extends javax.swing.JPanel {

    /**
	 * 
	 */
	
	private Agencia agencia;
    private static MecanismoDePersistenciaSeguro mecanismoDePersistenciaAgencia;
    private Locador gerente;
    private List<Locador> usuarios;
    private static MecanismoDePersistenciaSeguro mecanismoDePersistenciaUsuarios;
    private static GeradorDeLogs geradorDeLog;
    private Data hoje;

    public InterfaceMenuGerente() {
            hoje = new Data();
            try {
                geradorDeLog = new GeradorDeLogs();
            } catch (Exception e) {
            }
            
            try {
				geradorDeLog.escreveLog("O usuario "+ MainGrafico.getUsuarioLogado().getLogin() +" entrou no menu do gerente");
			} catch (Exception e) {
				
			}
            
            initComponents();
            lerDados();
            atualizarDisplays();
            for (TipoDeLogradouro tipo : TipoDeLogradouro.values()) {
                jComboBox1.addItem(tipo);
                jComboBox3.addItem(tipo);
            }
            for (UF estado : UF.values()) {
                jComboBox2.addItem(estado);
                jComboBox4.addItem(estado);
            }
            this.setVisible(true);
    }

    private void atualizarDisplays(){
        if ( gerente != null) {
            jTextField27.setText("Gerente "+gerente.getLogin()+" de nome "+gerente.getNome()+" esta logado...");
        }
        else{
          
        }
        if ( agencia != null ){
            jTextPane1.setText("Agencia "+agencia.getNomeFantasia()+"\n<Hoje eh "+hoje.getDataPorExtenso()+">");
        }
    }

    @SuppressWarnings("unchecked")
	private void lerDados(){
        try{
            mecanismoDePersistenciaAgencia = new MecanismoDePersistenciaSeguro("arquivos/agencia.ser");
            agencia = (Agencia) mecanismoDePersistenciaAgencia.recuperaObjetoNoArquivo();
            mecanismoDePersistenciaUsuarios = new MecanismoDePersistenciaSeguro("arquivos/locadores.ser");
            usuarios = (List<Locador>) mecanismoDePersistenciaUsuarios.recuperaDoArquivo();
            if(agencia == null){
            	agencia = getAgenciaDefault();
            }
            if ( usuarios == null ){
                usuarios = new ArrayList<Locador>();
            }
            if(usuarios.isEmpty()){
                usuarios.add(getGerenteDefault());
            }
            for ( Locador usuario : usuarios ){
                if ( usuario.getEhGerente() ){
                    gerente = usuario;
                }
            }
        }
        catch(Exception e){
            JOptionPane.showMessageDialog(null, "Houve um problema no carregamento do banco de dados do Sistema.", null, JOptionPane.ERROR_MESSAGE);
        }
    }

    private Agencia getAgenciaDefault(){
        Agencia defaults = null;
        try {
            defaults = new Agencia();
            defaults.setNomeFantasia("DEFAULT");
            defaults.setRazaoSocial("REPRESENTANTE DEFAULT");
            defaults.setTelefone("(83) 8888-8888");
            defaults.setEmail("default@default.com");
            defaults.setCNPJ("11111111111111");
            defaults.setInscricaoEstadual("111111111111");
            Endereco endereco = new Endereco();
            endereco.setTipoDeLogradouro(TipoDeLogradouro.Viaduto);
            endereco.setLogradouro("RUA DEFAULT");
            endereco.setNumero(1);
            endereco.setBairro("BAIRRO DEFAULT");
            endereco.setCidade("CIDADE DEFAULT");
            endereco.setEstado(UF.PB);
            endereco.setObs("OBS DEFAULT");
            endereco.setCep("58310000");
            defaults.setEndereco(endereco);
            return defaults;
        } catch (Exception e) {
        }
        return defaults;
    }

    private Locador getGerenteDefault() {
        Locador defaults = new Locador();
        try {
            defaults.setNome("ADMINISTRADOR DO SISTEMA");
            defaults.setTelefone("(83) 0000-0000");
            defaults.setEmail("admin@default.com");
            defaults.setCPF("00000000000");
            defaults.setRG("000000000");
            defaults.setDataDeNascimento(new Data(26,3,1992));
            defaults.setNaturalidade("Hardware");
            defaults.setLogin("admin");
            defaults.setSenha("admin");
            defaults.setEhGerente(true);
            Endereco endereco = new Endereco();
            endereco.setTipoDeLogradouro(TipoDeLogradouro.Viaduto);
            endereco.setLogradouro(", logo abaixo");
            endereco.setNumero(155);
            endereco.setBairro("Bairro Defaut");
            endereco.setCidade("Cidade Default");
            endereco.setEstado(UF.PB);
            endereco.setObs("");
            endereco.setCep("00000000");
            defaults.setEndereco(endereco);
        } catch (Exception e) {
        }
        return defaults;
    }

    public void limparCampos(){
        jTextField1.setText("");
        jTextField2.setText("");
        jTextField3.setText("");
        jTextField4.setText("");
        jTextField5.setText("");
        jTextField6.setText("");
        jTextField8.setText("");
        jTextField9.setText("");
        jTextField10.setText("");
        jTextField11.setText("");
        jTextField12.setText("");
        jTextField14.setText("");
        jTextField15.setText("");
        jTextField16.setText("");
        jTextField17.setText("");
        jTextField18.setText("");
        jTextField19.setText("");
        jTextField20.setText("");
        jTextField21.setText("");
        jTextField22.setText("");
        jTextField23.setText("");
        jTextField24.setText("");
        jTextField25.setText("");
        jTextField26.setText("");
        jTextField28.setText("");
        jPasswordField1.setText("");
        jLabel1.setForeground(Color.BLACK);
        jLabel2.setForeground(Color.BLACK);
        jLabel3.setForeground(Color.BLACK);
        jLabel4.setForeground(Color.BLACK);
        jLabel5.setForeground(Color.BLACK);
        jLabel6.setForeground(Color.BLACK);
        jLabel7.setForeground(Color.BLACK);
        jLabel8.setForeground(Color.BLACK);
        jLabel9.setForeground(Color.BLACK);
        jLabel10.setForeground(Color.BLACK);
        jLabel11.setForeground(Color.BLACK);
        jLabel12.setForeground(Color.BLACK);
        jLabel15.setForeground(Color.BLACK);
        jLabel16.setForeground(Color.BLACK);
        jLabel17.setForeground(Color.BLACK);
        jLabel18.setForeground(Color.BLACK);
        jLabel19.setForeground(Color.BLACK);
        jLabel20.setForeground(Color.BLACK);
        jLabel21.setForeground(Color.BLACK);
        jLabel23.setForeground(Color.BLACK);
        jLabel24.setForeground(Color.BLACK);
        jLabel25.setForeground(Color.BLACK);
        jLabel26.setForeground(Color.BLACK);
        jLabel27.setForeground(Color.BLACK);
        jLabel30.setForeground(Color.BLACK);
        jLabel31.setForeground(Color.BLACK);
    }

    @SuppressWarnings("deprecation")
	private void editaGerente(){
        jLabel15.setForeground(Color.BLACK);
        jLabel16.setForeground(Color.BLACK);
        jLabel17.setForeground(Color.BLACK);
        jLabel18.setForeground(Color.BLACK);
        jLabel19.setForeground(Color.BLACK);
        jLabel20.setForeground(Color.BLACK);
        jLabel21.setForeground(Color.BLACK);
        jLabel23.setForeground(Color.BLACK);
        jLabel24.setForeground(Color.BLACK);
        jLabel25.setForeground(Color.BLACK);
        jLabel26.setForeground(Color.BLACK);
        jLabel27.setForeground(Color.BLACK);
        jLabel30.setForeground(Color.BLACK);
        jLabel31.setForeground(Color.BLACK);
        List<TipoDeEntradaInvalida> entradasInvalidas = new ArrayList<TipoDeEntradaInvalida>();


        try {
            gerente.setNome(jTextField14.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.NOME);
        }

        try {
            gerente.setTelefone(jTextField15.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.TELEFONE);
        }

        try {
            gerente.setEmail(jTextField16.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.EMAIL);
        }

        try {
            gerente.setCPF(jTextField17.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.CPF);
        }

        try {
            gerente.setRG(jTextField18.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.RG);
        }

        try {
            int dia = Integer.parseInt(jTextField19.getText().split("/")[0]);
            int mes = Integer.parseInt(jTextField19.getText().split("/")[1]);
            int ano = Integer.parseInt(jTextField19.getText().split("/")[2]);
            gerente.setDataDeNascimento(new Data(dia, mes, ano));
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.DATA);
        }

        try {
            gerente.setNaturalidade(jTextField20.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.NATURALIDADE);
        }

        Endereco endereco = new Endereco();
        try {
            endereco.setTipoDeLogradouro((TipoDeLogradouro) jComboBox3.getSelectedItem());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.TIPO_DE_LOGRADOURO);
        }
        try {
            endereco.setLogradouro(jTextField21.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.LOGRADOURO);
        }
        try {
            endereco.setNumero(Integer.parseInt(jTextField22.getText()));
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.NUMERO_ENDERECO);
        }
        try {
            endereco.setObs(jTextField25.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.OBSERVACAO);
        }
        try {
            endereco.setBairro(jTextField23.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.BAIRRO);
        }
        try {
            endereco.setCidade(jTextField24.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.CIDADE);
        }
        try {
            endereco.setEstado((UF) jComboBox4.getSelectedItem());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.ESTADO);
        }
        try {
            endereco.setCep(jTextField26.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.CEP);
        }

        try {
            gerente.setEndereco(endereco);
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.ENDERECO);
        }

        try {
            gerente.setLogin(jTextField28.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.LOGIN);
        }

        try {
            gerente.setSenha(jPasswordField1.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.SENHA);
        }

        if (entradasInvalidas.size() == 0) {
            jLabel15.setForeground(Color.BLACK);
            jLabel16.setForeground(Color.BLACK);
            jLabel17.setForeground(Color.BLACK);
            jLabel18.setForeground(Color.BLACK);
            jLabel19.setForeground(Color.BLACK);
            jLabel20.setForeground(Color.BLACK);
            jLabel21.setForeground(Color.BLACK);
            jLabel23.setForeground(Color.BLACK);
            jLabel24.setForeground(Color.BLACK);
            jLabel25.setForeground(Color.BLACK);
            jLabel26.setForeground(Color.BLACK);
            jLabel27.setForeground(Color.BLACK);
            jLabel30.setForeground(Color.BLACK);
            jLabel31.setForeground(Color.BLACK);
            atualizarDisplays();
            try {
				geradorDeLog.escreveLog("Dados do gerente modificados.");
			} catch (Exception e) {
				
			}
            JOptionPane.showMessageDialog(null, "Edicao efetuada com sucesso!", "Edicao realizada", JOptionPane.PLAIN_MESSAGE);
            persistirDados();
        }
        else{
           
            atualizarDisplays();
            JOptionPane.showMessageDialog(null, "Edicao nao efetuada completamente, ver campos em destaque.", "Edicao com erros",JOptionPane.ERROR_MESSAGE);
            for ( TipoDeEntradaInvalida entradaInvalida : entradasInvalidas ){
                if ( entradaInvalida == TipoDeEntradaInvalida.NOME ){
                    jLabel15.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.TELEFONE ){
                    jLabel16.setForeground(Color.RED);
                    jTextField15.setText("(XX) XXXX-XXXX");
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.EMAIL ){
                    jLabel17.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.CPF ){
                    jLabel18.setForeground(Color.RED);
                    jTextField3.setText("XXX.XXX.XXX-XX");
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.RG ){
                    jLabel19.setForeground(Color.RED);
                    jTextField4.setText("XXXXXXXX (7 a 12)");
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.DATA ){
                    jLabel20.setForeground(Color.RED);
                    jTextField19.setText("DD/MM/AAAA");
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.NATURALIDADE ){
                    jLabel21.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.NUMERO_ENDERECO ){
                    jLabel23.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.BAIRRO ){
                    jLabel24.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.CIDADE ){
                    jLabel25.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.OBSERVACAO ){
                    jLabel26.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.CEP ){
                    jLabel27.setForeground(Color.RED);
                    jTextField12.setText("XXXXXXXX (8)");
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.LOGIN ){
                    jLabel30.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.SENHA ){
                    jLabel31.setForeground(Color.RED);
                    jPasswordField1.setText("(Minimo de 5 caracteres)");
                }
            }
        }
    }

    private void editaAgencia(){
        jLabel1.setForeground(Color.BLACK);
        jLabel2.setForeground(Color.BLACK);
        jLabel3.setForeground(Color.BLACK);
        jLabel4.setForeground(Color.BLACK);
        jLabel5.setForeground(Color.BLACK);
        jLabel6.setForeground(Color.BLACK);
        jLabel7.setForeground(Color.BLACK);
        jLabel8.setForeground(Color.BLACK);
        jLabel9.setForeground(Color.BLACK);
        jLabel10.setForeground(Color.BLACK);
        jLabel11.setForeground(Color.BLACK);
        jLabel12.setForeground(Color.BLACK);
        List<TipoDeEntradaInvalida> entradasInvalidas = new ArrayList<TipoDeEntradaInvalida>();
      

        try {
            agencia.setNomeFantasia(jTextField1.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.NOME_FANTASIA);
        }

        try {
            agencia.setTelefone(jTextField5.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.TELEFONE);
        }

        try {
            agencia.setEmail(jTextField6.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.EMAIL);
        }

        try {
            agencia.setCNPJ(jTextField3.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.CNPJ);
        }

        try {
            agencia.setInscricaoEstadual(jTextField4.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.INSCRICAO_ESTADUAL);
        }

        try {
            agencia.setRazaoSocial(jTextField2.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.RAZAO_SOCIAL);
        }

        Endereco endereco = new Endereco();
        try {
            endereco.setTipoDeLogradouro((TipoDeLogradouro) jComboBox1.getSelectedItem());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.TIPO_DE_LOGRADOURO);
        }
        try {
            endereco.setLogradouro(jTextField7.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.LOGRADOURO);
        }
        try {
            endereco.setNumero(Integer.parseInt(jTextField8.getText()));
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.NUMERO_ENDERECO);
        }
        try {
            endereco.setObs(jTextField11.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.OBSERVACAO);
        }
        try {
            endereco.setBairro(jTextField9.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.BAIRRO);
        }
        try {
            endereco.setCidade(jTextField10.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.CIDADE);
        }
        try {
            endereco.setEstado((UF) jComboBox2.getSelectedItem());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.ESTADO);
        }
        try {
            endereco.setCep(jTextField12.getText());
        } catch (Exception e) {
            entradasInvalidas.add(TipoDeEntradaInvalida.CEP);
        }

        Endereco antigo = agencia.getEndereco();
        try {
            agencia.setEndereco(endereco);
        } catch (Exception e) {
            try{
               agencia.setEndereco(antigo);
            }
            catch(Exception f){}
            entradasInvalidas.add(TipoDeEntradaInvalida.ENDERECO);
        }

        if (entradasInvalidas.size() == 0) {
            jLabel1.setForeground(Color.BLACK);
            jLabel2.setForeground(Color.BLACK);
            jLabel3.setForeground(Color.BLACK);
            jLabel4.setForeground(Color.BLACK);
            jLabel5.setForeground(Color.BLACK);
            jLabel6.setForeground(Color.BLACK);
            jLabel7.setForeground(Color.BLACK);
            jLabel8.setForeground(Color.BLACK);
            jLabel9.setForeground(Color.BLACK);
            jLabel10.setForeground(Color.BLACK);
            jLabel11.setForeground(Color.BLACK);
            jLabel12.setForeground(Color.BLACK);
            atualizarDisplays();
            try {
				geradorDeLog.escreveLog("Dados da agencia modificados.");
			} catch (Exception e) {
				
			}
            JOptionPane.showMessageDialog(null, "Edicao efetuada com sucesso!", "Edicao realizada", JOptionPane.PLAIN_MESSAGE);
            persistirDados();
        }
        else{
            persistirDados();
            atualizarDisplays();
            JOptionPane.showMessageDialog(null, "Edicao nao efetuada completamente, ver campos em destaque.", "Edicao com erros",JOptionPane.ERROR_MESSAGE);
            for ( TipoDeEntradaInvalida entradaInvalida : entradasInvalidas ){
                if ( entradaInvalida == TipoDeEntradaInvalida.NOME_FANTASIA ){
                    jLabel1.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.TELEFONE ){
                    jLabel5.setForeground(Color.RED);
                    jTextField5.setText("(XX) XXXX-XXXX");
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.EMAIL ){
                    jLabel6.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.CNPJ ){
                    jLabel3.setForeground(Color.RED);
                    jTextField3.setText("XXXXXXXXXXXXXX (14)");
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.INSCRICAO_ESTADUAL ){
                    jLabel4.setForeground(Color.RED);
                    jTextField4.setText("XXXXXXXXXXXX (12)");
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.RAZAO_SOCIAL ){
                    jLabel2.setForeground(Color.RED);
                    jTextField2.setText("");
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.NUMERO_ENDERECO ){
                    jLabel8.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.BAIRRO ){
                    jLabel9.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.CIDADE ){
                    jLabel10.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.OBSERVACAO ){
                    jLabel11.setForeground(Color.RED);
                }
                else if ( entradaInvalida == TipoDeEntradaInvalida.CEP ){
                    jLabel12.setForeground(Color.RED);
                    jTextField12.setText("XXXXXXXX (8 digitos)");
                }
            }
        }
    }

    @SuppressWarnings("unchecked")
	private void persistirDados(){

        try{
           geradorDeLog.escreveLog("Gravando dados");
           mecanismoDePersistenciaAgencia.persisteObjetoNoArquivo(agencia);
           mecanismoDePersistenciaUsuarios.persisteNoArquivo((ArrayList)usuarios);
        }catch(Exception e){
        	
        }

    }

   
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jLabel13 = new javax.swing.JLabel();
        jButton4 = new javax.swing.JButton();
        jButton13 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTextField4 = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jTextField5 = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jTextField6 = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel8 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jTextField7 = new javax.swing.JTextField();
        jTextField8 = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jTextField9 = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jTextField10 = new javax.swing.JTextField();
        jComboBox2 = new javax.swing.JComboBox();
        jLabel11 = new javax.swing.JLabel();
        jTextField11 = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jTextField12 = new javax.swing.JTextField();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        jTextField14 = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jTextField15 = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        jTextField16 = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jTextField17 = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        jTextField18 = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        jTextField19 = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        jTextField20 = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        jSeparator3 = new javax.swing.JSeparator();
        jSeparator4 = new javax.swing.JSeparator();
        jComboBox3 = new javax.swing.JComboBox();
        jTextField21 = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        jTextField22 = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        jTextField23 = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        jTextField24 = new javax.swing.JTextField();
        jComboBox4 = new javax.swing.JComboBox();
        jLabel26 = new javax.swing.JLabel();
        jTextField25 = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        jTextField26 = new javax.swing.JTextField();
        jButton11 = new javax.swing.JButton();
        jButton12 = new javax.swing.JButton();
        jLabel30 = new javax.swing.JLabel();
        jTextField28 = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        jPasswordField1 = new javax.swing.JPasswordField();
        jPanel5 = new javax.swing.JPanel();
        textArea1 = new java.awt.TextArea();
        jLabel14 = new javax.swing.JLabel();
        jTextField13 = new javax.swing.JTextField();
        jButton14 = new javax.swing.JButton();
        jProgressBar1 = new javax.swing.JProgressBar();
        jTextField27 = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jSeparator5 = new javax.swing.JSeparator();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTextPane1 = new javax.swing.JTextPane();

        setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        setMaximumSize(new java.awt.Dimension(460, 514));
        setMinimumSize(new java.awt.Dimension(460, 514));

        jTabbedPane1.setName("linkLogout"); // NOI18N
        jTabbedPane1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTabbedPane1MouseClicked(evt);
            }
        });
        jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jTabbedPane1StateChanged(evt);
            }
        });
        jTabbedPane1.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTabbedPane1FocusGained(evt);
            }
        });
        jTabbedPane1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jTabbedPane1PropertyChange(evt);
            }
        });
        jTabbedPane1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTabbedPane1KeyPressed(evt);
            }
        });

        jPanel1.setName("painelGerenciar"); // NOI18N

        jButton1.setText("Clientes Pessoa Fisica");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Clientes Pessoa Juridica");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("Locadores");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton5.setText("Planos de Locacao");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jLabel13.setText("Permite realizar cadastros, edicoes e exclusoes...");

        jButton4.setText("Automoveis");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton13.setText("Motocicletas");
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel13)
                    .addComponent(jButton3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 409, Short.MAX_VALUE)
                    .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 409, Short.MAX_VALUE)
                    .addComponent(jButton2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 409, Short.MAX_VALUE)
                    .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 409, Short.MAX_VALUE)
                    .addComponent(jButton13, javax.swing.GroupLayout.DEFAULT_SIZE, 409, Short.MAX_VALUE)
                    .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 409, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel13)
                .addGap(18, 18, 18)
                .addComponent(jButton3)
                .addGap(18, 18, 18)
                .addComponent(jButton1)
                .addGap(18, 18, 18)
                .addComponent(jButton2)
                .addGap(18, 18, 18)
                .addComponent(jButton4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton13)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton5)
                .addContainerGap(27, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Gerenciar...", jPanel1);

        jPanel2.setName("painelAgencia"); // NOI18N

        jLabel1.setText("Nome de Fantasia:");

        jLabel2.setText("Razao Social:");

        jLabel3.setText("CNPJ:");

        jLabel4.setText("Insc. UF:");

        jLabel5.setText("Tel.:");

        jLabel6.setText("Email:");

        jLabel7.setText("Endereco");

        jLabel8.setText("No.:");

        jLabel9.setText("Bairro:");

        jLabel10.setText("Cidade:");

        jLabel11.setText("Obs.:");

        jLabel12.setText("CEP:");

        jButton6.setText("Limpar");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jButton7.setText("Salvar");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(4, 4, 4)
                        .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel5)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField5))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addGap(4, 4, 4)
                                .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(3, 3, 3)
                                .addComponent(jLabel4)
                                .addGap(2, 2, 2)
                                .addComponent(jTextField4, javax.swing.GroupLayout.DEFAULT_SIZE, 195, Short.MAX_VALUE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(4, 4, 4)
                                .addComponent(jLabel6)
                                .addGap(4, 4, 4)
                                .addComponent(jTextField6, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE))))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(4, 4, 4)
                        .addComponent(jLabel7)
                        .addGap(4, 4, 4)
                        .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel9)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jTextField7, javax.swing.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(4, 4, 4)
                                .addComponent(jLabel10)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField10, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE)
                                .addGap(18, 18, 18)
                                .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField12, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 147, Short.MAX_VALUE)
                        .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4)
                    .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7)
                    .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)
                    .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12)
                    .addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton6)
                    .addComponent(jButton7))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Agencia", jPanel2);
        {
        	jPanel3 = new javax.swing.JPanel();
        	jTabbedPane1.addTab("Locacoes/Devolucoes", null, jPanel3, null);
        	GroupLayout jPanel3Layout = new GroupLayout((JComponent)jPanel3);
        	jPanel3Layout.setHorizontalGroup(jPanel3Layout.createSequentialGroup());
        	jPanel3Layout.setVerticalGroup(jPanel3Layout.createSequentialGroup());
        	jPanel3.setLayout(jPanel3Layout);
        	jPanel3.setName("painelEfetuar"); // NOI18N
        }
        
        jPanel4.setName("painelGerente"); // NOI18N

        jLabel15.setText("Nome:");

        jLabel16.setText("Telefone:");

        jLabel17.setText("Email:");

        jLabel18.setText("CPF:");

        jLabel19.setText("RG:");

        jTextField18.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField18ActionPerformed(evt);
            }
        });

        jLabel20.setText("Data:");

        jLabel21.setText("Naturalidade:");

        jLabel22.setText("Endereco");

        jLabel23.setText("No.:");

        jTextField22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField22ActionPerformed(evt);
            }
        });

        jLabel24.setText("Bairro:");

        jLabel25.setText("Cidade:");

        jLabel26.setText("Obs.:");

        jLabel27.setText("CEP:");

        jButton11.setText("Limpar");
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton11ActionPerformed(evt);
            }
        });

        jButton12.setText("Salvar");
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton12ActionPerformed(evt);
            }
        });

        jLabel30.setText("Login:");

        jLabel31.setText("Senha:");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setVerticalGroup(jPanel4Layout.createSequentialGroup()
        	.addContainerGap()
        	.addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	    .addComponent(jTextField14, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel15, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	.addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	    .addComponent(jTextField16, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel17, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel16, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jTextField15, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	.addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	    .addComponent(jTextField18, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel19, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel18, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jTextField17, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	.addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	    .addComponent(jTextField19, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel20, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel21, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jTextField20, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	.addGroup(jPanel4Layout.createParallelGroup()
        	    .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	        .addComponent(jSeparator4, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE)
        	        .addComponent(jSeparator3, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE))
        	    .addComponent(jLabel22, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	.addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	    .addComponent(jTextField22, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jTextField21, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel23, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jComboBox3, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	.addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	    .addComponent(jComboBox4, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jTextField23, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel25, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jTextField24, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel24, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	.addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	    .addComponent(jTextField26, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel27, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel26, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jTextField25, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	.addGap(65)
        	.addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	    .addComponent(jPasswordField1, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel31, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jLabel30, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jTextField28, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 0, Short.MAX_VALUE)
        	.addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	    .addComponent(jButton11, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	    .addComponent(jButton12, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	.addContainerGap());
        jPanel4Layout.setHorizontalGroup(jPanel4Layout.createSequentialGroup()
        	.addContainerGap()
        	.addGroup(jPanel4Layout.createParallelGroup()
        	    .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	        .addGroup(jPanel4Layout.createParallelGroup()
        	            .addGroup(jPanel4Layout.createSequentialGroup()
        	                .addGroup(jPanel4Layout.createParallelGroup()
        	                    .addComponent(jLabel30, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                    .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                        .addComponent(jLabel26, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED))
        	                    .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                        .addComponent(jComboBox3, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                        .addGap(12))
        	                    .addComponent(jLabel20, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                    .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                        .addComponent(jLabel18, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                        .addGap(10)))
        	                .addGroup(jPanel4Layout.createParallelGroup()
        	                    .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                        .addComponent(jTextField19, GroupLayout.PREFERRED_SIZE, 67, GroupLayout.PREFERRED_SIZE)
        	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	                        .addComponent(jTextField21, 0, 216, Short.MAX_VALUE))
        	                    .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                        .addComponent(jTextField17, GroupLayout.PREFERRED_SIZE, 136, GroupLayout.PREFERRED_SIZE)
        	                        .addGap(148))))
        	            .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                .addComponent(jButton11, GroupLayout.PREFERRED_SIZE, 126, GroupLayout.PREFERRED_SIZE)
        	                .addGap(25)
        	                .addComponent(jLabel25, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                .addGap(123))
        	            .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                .addComponent(jLabel16, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	                .addComponent(jTextField15, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE)
        	                .addGap(148)))
        	        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 1, GroupLayout.PREFERRED_SIZE)
        	        .addComponent(jLabel23, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
        	        .addGroup(jPanel4Layout.createParallelGroup()
        	            .addComponent(jComboBox4, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 66, GroupLayout.PREFERRED_SIZE)
        	            .addComponent(jTextField22, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 66, GroupLayout.PREFERRED_SIZE)))
        	    .addGroup(jPanel4Layout.createSequentialGroup()
        	        .addGroup(jPanel4Layout.createParallelGroup()
        	            .addComponent(jLabel24, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	            .addComponent(jLabel15, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	        .addGap(8)
        	        .addGroup(jPanel4Layout.createParallelGroup()
        	            .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                .addComponent(jTextField28, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE)
        	                .addComponent(jTextField24, 0, 158, Short.MAX_VALUE)
        	                .addGap(84))
        	            .addGroup(jPanel4Layout.createSequentialGroup()
        	                .addGroup(jPanel4Layout.createParallelGroup()
        	                    .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                        .addComponent(jTextField23, GroupLayout.PREFERRED_SIZE, 90, GroupLayout.PREFERRED_SIZE)
        	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 0, Short.MAX_VALUE)
        	                        .addComponent(jLabel21, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	                    .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                        .addComponent(jTextField25, GroupLayout.PREFERRED_SIZE, 130, GroupLayout.PREFERRED_SIZE)
        	                        .addGroup(jPanel4Layout.createParallelGroup()
        	                            .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                                .addComponent(jLabel19, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                                .addGap(0, 16, Short.MAX_VALUE))
        	                            .addGroup(jPanel4Layout.createSequentialGroup()
        	                                .addComponent(jLabel17, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                                .addGap(0, 0, Short.MAX_VALUE)))
        	                        .addGap(12)))
        	                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	                .addGroup(jPanel4Layout.createParallelGroup()
        	                    .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                        .addComponent(jLabel31, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	                        .addGroup(jPanel4Layout.createParallelGroup()
        	                            .addComponent(jPasswordField1, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 162, GroupLayout.PREFERRED_SIZE)
        	                            .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                                .addGap(0, 35, GroupLayout.PREFERRED_SIZE)
        	                                .addComponent(jButton12, GroupLayout.PREFERRED_SIZE, 127, GroupLayout.PREFERRED_SIZE)))
        	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED))
        	                    .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	                        .addComponent(jLabel27, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 0, GroupLayout.PREFERRED_SIZE)
        	                        .addComponent(jTextField26, GroupLayout.PREFERRED_SIZE, 178, GroupLayout.PREFERRED_SIZE)
        	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED))
        	                    .addComponent(jTextField18, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 220, GroupLayout.PREFERRED_SIZE)
        	                    .addGroup(jPanel4Layout.createSequentialGroup()
        	                        .addPreferredGap(jLabel31, jTextField20, LayoutStyle.ComponentPlacement.INDENT)
        	                        .addGroup(jPanel4Layout.createParallelGroup()
        	                            .addComponent(jTextField20, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 208, GroupLayout.PREFERRED_SIZE)
        	                            .addComponent(jTextField16, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 208, GroupLayout.PREFERRED_SIZE)))))
        	            .addComponent(jTextField14, GroupLayout.Alignment.LEADING, 0, 399, Short.MAX_VALUE)))
        	    .addGroup(GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
        	        .addComponent(jSeparator3, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE)
        	        .addGap(7)
        	        .addComponent(jLabel22, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	        .addComponent(jSeparator4, 0, 355, Short.MAX_VALUE)))
        	.addContainerGap());

        jTabbedPane1.addTab("Gerente", jPanel4);

        jPanel5.setName("painelLogs"); // NOI18N

        textArea1.setEditable(false);

        jLabel14.setText("Quantas acoes previas voce deseja consutar:");

        jButton14.setText("OK");
        jButton14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton14ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(textArea1, javax.swing.GroupLayout.DEFAULT_SIZE, 410, Short.MAX_VALUE)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton14, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton14))
                .addGap(12, 12, 12)
                .addComponent(textArea1, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Relatorio de Logs", jPanel5);

        jProgressBar1.setName("linkLogout"); // NOI18N
        jTabbedPane1.addTab("Logout", jProgressBar1);

        jTextField27.setEditable(false);

        jLabel29.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
        jLabel29.setText("Bem vindo ao Sistema LocaLisa!");

        jLabel32.setFont(new java.awt.Font("DejaVu Sans", 1, 14));
        jLabel32.setText("Menu do Gerente");

        jTextPane1.setBackground(new java.awt.Color(145, 135, 127));
        jTextPane1.setEditable(false);
        jTextPane1.setFont(new java.awt.Font("DejaVu Sans", 3, 13));
        jTextPane1.setText("Agencia");
        jScrollPane2.setViewportView(jTextPane1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel32)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jSeparator5, javax.swing.GroupLayout.DEFAULT_SIZE, 287, Short.MAX_VALUE))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(12, 12, 12)
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 407, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jTextField27, javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 437, Short.MAX_VALUE))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(120, 120, 120)
                        .addComponent(jLabel29)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel32)
                        .addGap(2, 2, 2))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 382, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel29)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jTabbedPane1.getAccessibleContext().setAccessibleName("Gerenciar...");
    }// </editor-fold>//GEN-END:initComponents

    private void jTabbedPane1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTabbedPane1KeyPressed
    }//GEN-LAST:event_jTabbedPane1KeyPressed

    private void jTabbedPane1PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1PropertyChange
    }//GEN-LAST:event_jTabbedPane1PropertyChange

    private void jTabbedPane1FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTabbedPane1FocusGained
    }//GEN-LAST:event_jTabbedPane1FocusGained

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        if ( jTabbedPane1.getSelectedComponent().getName().equals("painelGerente") ){
            selecionarGerente();
        } else if ( jTabbedPane1.getSelectedComponent().getName().equals("painelAgencia") ){
            selecionarAgencia();
        } else if ( jTabbedPane1.getSelectedComponent().getName().equals("linkLogout") ){
            MainGrafico.entrarNaArea(new InterfaceLogin(), Constantes.INTERFACE_TAMANHO_LOGIN[0], Constantes.INTERFACE_TAMANHO_LOGIN[1]);
            MainGrafico.sairDaArea(this);
            MainGrafico.setUsuarioLogado(null);
            MainGrafico.setMenuCorrente(null);
        }
        else if ( jTabbedPane1.getSelectedComponent().getName().equals("painelEfetuar") ){
            MainGrafico.entrarNaArea(new InterfaceLocacao(), Constantes.INTERFACE_TAMANHO_LOCACAO[0], Constantes.INTERFACE_TAMANHO_LOCACAO[1]);
            MainGrafico.sairDaArea(this);
        }
}//GEN-LAST:event_jTabbedPane1StateChanged

    private void jTabbedPane1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPane1MouseClicked
    }//GEN-LAST:event_jTabbedPane1MouseClicked

    private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
        editaGerente();
    }//GEN-LAST:event_jButton12ActionPerformed

    private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
        limparCampos();
    }//GEN-LAST:event_jButton11ActionPerformed

    private void jTextField22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField22ActionPerformed
    }//GEN-LAST:event_jTextField22ActionPerformed

    private void jTextField18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField18ActionPerformed
    }//GEN-LAST:event_jTextField18ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        editaAgencia();
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        limparCampos();
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        MainGrafico.entrarNaArea(new InterfaceClienteFisico(), Constantes.INTERFACE_TAMANHO_PESSOA[0], Constantes.INTERFACE_TAMANHO_PESSOA[1]);
        MainGrafico.sairDaArea(this);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        MainGrafico.entrarNaArea(new InterfaceLocador(), Constantes.INTERFACE_TAMANHO_PESSOA[0], Constantes.INTERFACE_TAMANHO_PESSOA[1]);
        MainGrafico.sairDaArea(this);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        MainGrafico.entrarNaArea(new InterfaceClienteJuridico(), Constantes.INTERFACE_TAMANHO_PESSOA[0]+200, Constantes.INTERFACE_TAMANHO_PESSOA[1]);
        MainGrafico.sairDaArea(this);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        MainGrafico.entrarNaArea(new InterfaceAutomovel(), Constantes.INTERFACE_TAMANHO_AUTOMOVEL[0], Constantes.INTERFACE_TAMANHO_AUTOMOVEL[1]);
        MainGrafico.sairDaArea(this);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
        MainGrafico.entrarNaArea(new InterfaceMotocicleta(), Constantes.INTERFACE_TAMANHO_AUTOMOVEL[0]-50, Constantes.INTERFACE_TAMANHO_AUTOMOVEL[1]-100);
        MainGrafico.sairDaArea(this);
    }//GEN-LAST:event_jButton13ActionPerformed

    private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed
        try{
            int qtdeLogs = Integer.parseInt(jTextField13.getText());
            if ( qtdeLogs <= 0 ){
                throw new Exception();
            }
            textArea1.setText(geradorDeLog.ultimasAcoes(qtdeLogs));
        }
        catch(Exception e){
            JOptionPane.showMessageDialog(null, "Voce deve entrar com um inteiro positivo valido!", "Entrada invalida", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jButton14ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        MainGrafico.entrarNaArea(new InterfacePlanoDeLocacao(), Constantes.INTERFACE_TAMANHO_PLANO[0], Constantes.INTERFACE_TAMANHO_PLANO[1]);
        MainGrafico.sairDaArea(this);
        MainGrafico.sairDaArea(this);
    }//GEN-LAST:event_jButton5ActionPerformed

    @SuppressWarnings("unused")
	private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        MainGrafico.entrarNaArea(new InterfaceLocacao(), Constantes.INTERFACE_TAMANHO_LOCACAO[0], Constantes.INTERFACE_TAMANHO_LOCACAO[1]);
        MainGrafico.sairDaArea(this);
    }//GEN-LAST:event_jButton8ActionPerformed

    private void selecionarGerente( ){
        limparCampos();
        jTextField14.setText(gerente.getNome());
        jTextField15.setText(gerente.getTelefone());
        jTextField16.setText(gerente.getEmail());
        jTextField17.setText(gerente.getCPF());
        jTextField18.setText(gerente.getRG());
        jTextField19.setText(gerente.getDataDeNascimento().getData());
        jTextField20.setText(gerente.getNaturalidade());
        jComboBox3.setSelectedItem(gerente.getEndereco().getTipoDeLogradouro());
        jTextField21.setText(gerente.getEndereco().getLogradouro());
        jTextField22.setText(new Integer(gerente.getEndereco().getNumero()).toString());
        jTextField23.setText(gerente.getEndereco().getBairro());
        jTextField24.setText(gerente.getEndereco().getCidade());
        jComboBox4.setSelectedItem(gerente.getEndereco().getEstado());
        jTextField25.setText(gerente.getEndereco().getObs());
        jTextField26.setText(gerente.getEndereco().getCep());
        jTextField28.setText(gerente.getLogin());
        jPasswordField1.setText("");
    }

    private void selecionarAgencia( ){
        limparCampos();
        jTextField1.setText(agencia.getNomeFantasia());
        jTextField5.setText(agencia.getTelefone());
        jTextField6.setText(agencia.getEmail());
        jTextField3.setText(agencia.getCNPJ());
        jTextField4.setText(agencia.getInscricaoEstadual());
        jTextField2.setText(agencia.getRazaoSocial());
        jComboBox1.setSelectedItem(agencia.getEndereco().getTipoDeLogradouro());
        jTextField7.setText(agencia.getEndereco().getLogradouro());
        jTextField8.setText(new Integer(agencia.getEndereco().getNumero()).toString());
        jTextField9.setText(agencia.getEndereco().getBairro());
        jTextField10.setText(agencia.getEndereco().getCidade());
        jComboBox2.setSelectedItem(agencia.getEndereco().getEstado());
        jTextField11.setText(agencia.getEndereco().getObs());
        jTextField12.setText(agencia.getEndereco().getCep());
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton14;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBox3;
    private javax.swing.JComboBox jComboBox4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPasswordField jPasswordField1;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField10;
    private javax.swing.JTextField jTextField11;
    private javax.swing.JTextField jTextField12;
    private javax.swing.JTextField jTextField13;
    private javax.swing.JTextField jTextField14;
    private javax.swing.JTextField jTextField15;
    private javax.swing.JTextField jTextField16;
    private javax.swing.JTextField jTextField17;
    private javax.swing.JTextField jTextField18;
    private javax.swing.JTextField jTextField19;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField20;
    private javax.swing.JTextField jTextField21;
    private javax.swing.JTextField jTextField22;
    private javax.swing.JTextField jTextField23;
    private javax.swing.JTextField jTextField24;
    private javax.swing.JTextField jTextField25;
    private javax.swing.JTextField jTextField26;
    private javax.swing.JTextField jTextField27;
    private javax.swing.JTextField jTextField28;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    private javax.swing.JTextField jTextField8;
    private javax.swing.JTextField jTextField9;
    private javax.swing.JTextPane jTextPane1;
    private java.awt.TextArea textArea1;
    // End of variables declaration//GEN-END:variables

}